Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpc-compat: remove Author from BlockForRpc #8146

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pnowosie
Copy link

@pnowosie pnowosie commented Jan 31, 2025

Changes

  • Removes Author field from BlockForRpc

Types of changes

Removes redundant field from RPC getBlockBy * response.

What types of changes does your code introduce?

  • Refactoring

Testing

Requires testing

  • Yes - Required test changes

If yes, did you write tests?

  • Yes

Copy link
Contributor

@MarekM25 MarekM25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls make CI green

@pnowosie pnowosie force-pushed the pnowosie/rpc-compat-get-block-remove-author branch from c54fbbf to 9ae4408 Compare January 31, 2025 12:31
@pnowosie pnowosie requested a review from MarekM25 January 31, 2025 12:53
Copy link
Member

@LukaszRozmej LukaszRozmej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think author made some sense for AuRa networks, not sure if it is needed though

@benaadams
Copy link
Member

I think author made some sense for AuRa networks, not sure if it is needed though

Could just change the

Author = block.Author ?? block.Beneficiary;

To

Author = block.Author;

And let the Json nullability remove it from output then?

@@ -30,7 +30,6 @@ protected BlockForRpc()
public BlockForRpc(Block block, bool includeFullTransactionData, ISpecProvider specProvider)
{
_isAuRaBlock = block.Header.AuRaSignature is not null;
Author = block.Author ?? block.Beneficiary;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to
Author = block.Author;

Then let [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] remove it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that better!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants